{% extends 'admin_base.html' %}

{%block main %}
<div class="col-md-8 col-md-offset-2">
    <div class="row">
        <h3>Blog Meta Data</h3><hr>
        <dl class="dl-horizontal">
            <dt>Blog Name:</dt>
            <dd>{{ blog_meta.name }}</dd>
        </dl>
        <dl class="dl-horizontal">
            <dt>Blog Subtitle:</dt>
            <dd>{{ blog_meta.subtitle }}</dd>
        </dl>
        <dl class="dl-horizontal">
            <dt>Blog Description:</dt>
            <dd>{{ blog_meta.description }}</dd>
        </dl>
        <dl class="dl-horizontal">
            <dt>Blog Owner:</dt>
            <dd>{{ blog_meta.owner }}</dd>
        </dl>
        <dl class="dl-horizontal">
            <dt>Blog Keywords:</dt>
            <dd>{{ blog_meta.keywords }}</dd>
        </dl>
    </div>
    <div class="row">
        <h3>
            About User &nbsp;
            <small><a href="{{ url_for('accounts.settings') }}"><span class="glyphicon glyphicon-edit" aria-hidden="true"></span> </a></small>
        </h3>
        <hr>
        <dl class="dl-horizontal">
            <dt>Username Name:</dt>
            <dd>{{ user.username }}</dd>
        </dl>
        <dl class="dl-horizontal">
            <dt>Display Name:</dt>
            <dd>{{ user.display_name }}</dd>
        </dl>
        <dl class="dl-horizontal">
            <dt>Biography:</dt>
            <dd>{{ user.biography }}</dd>
        </dl>
        <dl class="dl-horizontal">
            <dt>Social Network:</dt>
            <dd>
                {% if user.social_networks['github']['url'] %}
                    <a href='{{ user.social_networks["github"]["url"] }}'><i class="fa fa-github fa-lg"></i></a>
                {% endif %}
                {% if user.social_networks['twitter']['url'] %}
                    <a href='{{ user.social_networks["twitter"]["url"] }}'><i class="fa fa-twitter fa-lg"></i></a>
                {% endif %}
                {% if user.social_networks['weibo']['url'] %}
                    <a href='{{ user.social_networks["weibo"]["url"] }}'><i class="fa fa-weibo fa-lg"></i></a>
                {% endif %}
                {% if user.social_networks['facebook']['url'] %}
                    <a href='{{ user.social_networks["facebook"]["url"] }}'><i class="fa fa-facebook fa-lg"></i></a>
                {% endif %}
                {% if user.social_networks['linkedin']['url'] %}
                    <a href='{{ user.social_networks["linkedin"]["url"] }}'><i class="fa fa-linkedin fa-lg"></i></a>
                {% endif %}
                {% if user.social_networks['weixin']['url'] %}
                    <a id="btn_weixin" href='{{ user.social_networks["weixin"]["url"] }}'><i class="fa fa-weixin fa-lg"></i></a>
                    <!-- weixin -->
                    <div id="weixin" class="hidden">
                        <br>
                        <img src="{{ user.social_networks["weixin"]["url"] }}?imageView/2/w/150" title="weixin">
                    </div> 
                {% endif %}                
            </dd>
        </dl>
        <dl class="dl-horizontal">
            <dt>Homepage:</dt>
            <dd>
                {% if user.homepage_url %}
                <a href="{{ user.homepage_url }}"><i class="fa fa-home fa-lg"></i></a> {{ user.homepage_url }}
                {% else %}
                Not yet
                {% endif %}
            </dd>
        </dl>
    </div>
</div>
{% endblock %}

{% block js %}
<script type="text/javascript">
    $('#btn_weixin').on('click', function(event){
        if($('#weixin').hasClass('hidden'))
            $('#weixin').removeClass('hidden');
        else
            $('#weixin').addClass('hidden');
        return false
    })
    
    
</script>
{% endblock %}